//
//  XHVoiceView.m
//  BSNoAnswer
//
//  Created by Tiffany宝 on 16/5/21.
//  Copyright © 2016年 Tiffany. All rights reserved.
//

#import "XHVoiceView.h"
#import "XHTopicModel.h"

@interface XHVoiceView ()
@property (weak, nonatomic) IBOutlet UIImageView *iv_voiceImg;
@property (weak, nonatomic) IBOutlet UILabel *lb_playcount;
@property (weak, nonatomic) IBOutlet UILabel *lb_voicetime;

@end

@implementation XHVoiceView

+(instancetype)loadVoiceView{
    
    return [[NSBundle mainBundle]loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
}

-(void)setTopics:(XHTopicModel *)topics{
    
    _topics = topics;
    
    [self.iv_voiceImg sd_setImageWithURL:[NSURL URLWithString:topics.largeImage]];
    self.lb_playcount.text = [NSString stringWithFormat:@"%zd播放",topics.playcount];
    NSInteger time = topics.voicetime;
    NSInteger min = time / 60;
    NSInteger sec = time % 60;
    self.lb_voicetime.text = [NSString stringWithFormat:@"%02zd:%02zd",min,sec];
}

@end
